From: Stefan Monnier Date: Sun, 17 Oct 2010 17:30:22 +0000 (-0400) Subject: * lisp/minibuffer.el (completion--replace): Move point where it belongs X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~18^2~396 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a123af99cb4da898f3e8bad04a6c485b14f7e069;p=emacs.git * lisp/minibuffer.el (completion--replace): Move point where it belongs when there's a common suffix. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2d71ced5bc..6e7aadf2959 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-10-17 Stefan Monnier + + * minibuffer.el (completion--replace): Move point where it belongs + when there's a common suffix (bug#7215). + 2010-10-15 Michael Albinus * net/tramp.el (tramp-open-connection-setup-interactive-shell): diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a4ab5261f7c..bc5a1d2e807 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -498,10 +498,11 @@ Moves point to the end of the new text." (setq suffix-len (1+ suffix-len))) (unless (zerop suffix-len) (setq end (- end suffix-len)) - (setq newtext (substring newtext 0 (- suffix-len))))) - (goto-char beg) - (insert newtext) - (delete-region (point) (+ (point) (- end beg)))) + (setq newtext (substring newtext 0 (- suffix-len)))) + (goto-char beg) + (insert newtext) + (delete-region (point) (+ (point) (- end beg))) + (forward-char suffix-len))) (defun completion--do-completion (&optional try-completion-function) "Do the completion and return a summary of what happened.